/**
* 版权声明：厦门睿商网络科技有限公司 版权所有 违者必究
* 日    期：2020-05-25
*/
package com.rzico.order.entity;

import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * <pre>
 *   调拨单明细数据库对象
 * </pre>
 * @author Rzico Boot
 * @version 1.0
 */
@Data
@JsonIgnoreProperties(value = {"handler"})
@JsonInclude(JsonInclude.Include.NON_NULL)
@Table(name = "wx_allocate_item")
public class AllocateItem{
    @Id
    @ApiModelProperty(value = "" )
    protected Long id;

    @ApiModelProperty(value = "调拨单号" )
    protected Long allocateId;

    @ApiModelProperty(value = "创建日期" )
    protected java.util.Date createDate;

    @ApiModelProperty(value = "修改日期" )
    protected java.util.Date modifyDate;

    @ApiModelProperty(value = "商品编号" )
    protected Long productId;

    @ApiModelProperty(value = "商品名称" )
    protected String name;

    @ApiModelProperty(value = "货号条码" )
    protected String sn;

    @ApiModelProperty(value = "调拨价" )
    protected java.math.BigDecimal price;

    @ApiModelProperty(value = "单位" )
    protected String unit;

    @ApiModelProperty(value = "规格" )
    protected String spec;

    @ApiModelProperty(value = "数量" )
    protected java.math.BigDecimal quantity;

    @ApiModelProperty(value = "实际出库数量" )
    protected java.math.BigDecimal shippedQuantity;

    @ApiModelProperty(value = "实际入库数量" )
    protected java.math.BigDecimal receiviedQuantity;


    @ApiModelProperty(value = "商品金额")
    public BigDecimal getAmount(){
        return this.getPrice().multiply(this.getQuantity()).setScale(2,BigDecimal.ROUND_HALF_DOWN);
    }


}
